import requests

base_url = "https://www.baidu.com/s"
# 请求头
header = {"user-agent":
        "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"}
# 使用get请求
response = requests.get(base_url+"?"+"wd=python",headers=header)
# 指定编码方法
response.encoding = "utf-8"
# 保存文件
with open("get参数.html","w+",encoding="utf-8") as f:
    f.write(response.text)